<?php
	require_once ("db_connection.php");
	
	session_start();
	$pic = $_SESSION['varname'];
	$id = "ve-" . uniqid();
	$hrid ='';
	$date = date("Y-m-d H:i:s");
	$result='';
	$affiliateid = $_POST['affiliateid'];
	$vehiclemodel =mysql_real_escape_string($_POST["vehiclemodel"]);

		
	$query = "INSERT INTO vehicles(vehicleid,affiliateid,vehicletype,capacity,vehiclemodel, image, date)
	VALUES('$id','$affiliateid','$_POST[vehicletype]', '$_POST[capacity]', '$vehiclemodel', '$pic', '$date')";
	
	if(!mysql_query($query, $con)){
	die('Error: '. mysql_error());
	}
	
	echo "Saved!";
	flush();
	mysql_close($con);
?>